<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->headMeta(); ?>
	<?php echo $this->headTitle(); ?>
	<?php echo $this->headLink(); ?>
	<link href="<?php echo Petolio_Service_Util::autoVersion("/css/distribution.css"); ?>" media="screen" rel="stylesheet" type="text/css" />
	<?php echo $this->jQuery(); ?>
	<script type="text/javascript">var SITE_URL = '<?php echo PO_BASE_URL; ?>';</script>
	<script type="text/javascript">var LOCALE = '<?php echo $this->translate->getLocale(); ?>';</script>
	<?php echo $this->headScript(); ?>
</head>
<body><!-- site start -->

	<div id="fb-root"></div>
	<script>(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/<?php echo $this->translate->getLocale() == 'de' ? 'de_DE' : 'en_US'; ?>/all.js";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>
	<script type="text/javascript">
		var fbAppId = '<?php echo $this->fb_app_id; ?>';
		window.fbAsyncInit = function() {
			FB.init({appId: fbAppId, status: true, cookie: false, xfbml: true, channelUrl: '<?php echo PO_BASE_URL; ?>fbtest/channel.html'});

			var body = document.body,
			    html = document.documentElement;
			var height = Math.max( body.scrollHeight, body.offsetHeight, 
			                       html.clientHeight, html.scrollHeight, html.offsetHeight );
			
			FB.Canvas.setSize({width: 810, height: height});
		};
	</script>

	<div><?php echo $this->layout()->content; ?></div>
	<div id="showLoading_img" style="display: none;"><img src="/images/loading.gif" /></div><!-- site end -->
	<script type="text/javascript" src="<?php echo Petolio_Service_Util::autoVersion("/js/petolio.js"); ?>"></script>
	<script type="text/javascript">
		Petolio.translate({
			dialog: [
				'<?php echo $this->translate->_("Message"); ?>',
				'<?php echo $this->translate->_("Confirm"); ?>',
				'<?php echo $this->translate->_("OK"); ?>',
				'<?php echo $this->translate->_("Cancel"); ?>',
				'<?php echo $this->translate->_("Loading"); ?>',
				'<?php echo $this->translate->_("Please wait while loading..."); ?>',
				'<?php echo $this->translate->_("Server Error"); ?>',
				'<?php echo $this->translate->_("Sorry, the request could not be completed."); ?>',
				'<?php echo $this->translate->_("Please confirm action"); ?>'
			],
			chosen: {
				select_some_options: '<?php echo $this->translate->_("Select some Options"); ?>',
				select_an_option: '<?php echo $this->translate->_("Select an Option"); ?>',
				maximum_choices_reached: '<?php echo $this->translate->_("Maximum number of choices (%s) reached."); ?>',
				no_results_type: '<?php echo $this->translate->_("Start typing to search for results."); ?>',
				no_results_min: '<?php echo $this->translate->_("Please enter at least %s characters."); ?>',
				no_results_empty: '<?php echo $this->translate->_("No more results."); ?>',
				no_results_match: '<?php echo $this->translate->_('No results match "%s".'); ?>'
			}
		});

		$(Petolio.init);
		READY(ClueTip.init);
	</script>
</body>
</html>